<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Vote
 * @copyright  Copyright 2011 KEENONWEB LLC
 * @license    http://www.keenonweb.com/
 * @version    $Id: list.tpl 2011-03-09 01:11:30 idris $
 * @author     Idris
 */
?>

<div class="kowcore-list">
  <div class="kowcore-list-wrapper">

    <?php if ($this->paginator->getTotalItemCount()): ?>

    <?php if ($this->page > 1): ?>
    <div class="pagination pag-top">
      <?php echo $this->htmlLink($this->url( array( 'action' => 'rates', 'controller' => 'list', 'page' => ($this->page-1) ), 'kowcore_extended' ), $this->translate('Previous')); ?>
    </div>
    <div class="clr"></div>
    <?php endif; ?>

    <div class="list">
      <?php foreach ($this->paginator as $item): ?>
      <a href="<?php echo $item->getHref(); ?>" class="item" target="_blank">
      <span class="photo">
        <?php echo $this->objectPhoto($item, 'thumb.icon'); ?>
      </span>
      <span class="info">
        <span class="title">
          <?php echo $item->getTitle(); ?>
        </span>
        <?php if ($item->authorization()->isAllowed(null, 'view')): ?>
        <span class="status">
          <?php echo Engine_String::substr($item->status, 0, 100); ?>
        </span>
        <?php endif; ?>
        <span class="clr"></span>
      </span>
        <div class="clr"></div>
      </a>
      <?php endforeach; ?>
      <div class="clr"></div>
    </div>
    
    <?php if (count($this->paginator) > 1): ?>
    <div class="pagination pag-bottom">
      <?php echo $this->htmlLink($this->url( array( 'action' => 'rates', 'controller' => 'list', 'page' => ($this->page+1) ), 'kowcore_extended' ), $this->translate('Next')); ?>
    </div>
    <?php endif; ?>

    <?php else: ?>

    <div class="tip">
      <span>
        <?php echo $this->translate('No results found.');?>
      </span>
    </div>

    <?php endif; ?>

    <div class="clr"></div>
  </div>
</div>